<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>判断是否为合法数值</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.is-nan" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">is_nan</h1>
    <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">is_nan</span> &mdash; <span class="dc-title">判断是否为合法数值</span></p>

   </div>
   
 <div class="refsect1 description" id="refsect1-function.is-nan-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>is_nan</strong></span>
    ( <span class="methodparam"><span class="type">float</span> <code class="parameter">$val</code></span>
   ) : <span class="type">bool</span></div>

    <p class="para rdfs-comment">
     如果 <code class="parameter">val</code> 为“非数值”，例如
     <em>acos(1.01)</em> 的结果，则返回 <strong><code>TRUE</code></strong>。
    </p>
   </div>

   
 <div class="refsect1 parameters" id="refsect1-function.is-nan-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">val</code></dt>

     <dd>

      <p class="para">
       要检查的值
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.is-nan-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   如果 <code class="parameter">val</code> 不是一个数字（not a number）返回 <strong><code>TRUE</code></strong>，否则返回  <strong><code>FALSE</code></strong>。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.is-nan-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-4131">
    <p><strong>Example #1 <span class="function"><strong>is_nan()</strong></span> 例子</strong></p>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;Invalid&nbsp;calculation,&nbsp;will&nbsp;return&nbsp;a&nbsp;<br />//&nbsp;NaN&nbsp;value<br /></span><span style="color: #0000BB">$nan&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">acos</span><span style="color: #007700">(</span><span style="color: #0000BB">8</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$nan</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">is_nan</span><span style="color: #007700">(</span><span style="color: #0000BB">$nan</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
float(NAN)
bool(true)
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.is-nan-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="is_finite.html" class="function" rel="rdfs-seeAlso">is_finite()</a> - 判断是否为有限值</span></li>
    <li class="member"><span class="function"><a href="is_infinite.html" class="function" rel="rdfs-seeAlso">is_infinite()</a> - 判断是否为无限值</span></li>
   </ul>
  </p>
 </div>

  </div></div></div></body></html>